import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 专业方向信息 */
export interface MajorDirection {
          id: number; // 专业方向ID
          majorId?: number; // 专业ID
          directionName?: string; // 专业方向名称
          directionCode?: string; // 专业方向编码
          description: string; // 方向描述
          status?: number; // 状态（0正常 1停用）
    children?: MajorDirection[];
  }

// 专业方向 API
export const MajorDirectionApi = {
  // 查询专业方向列表
  getMajorDirectionList: async (params) => {
    return await request.get({ url: `/ao/major-direction/list`, params })
  },

  // 查询专业方向详情
  getMajorDirection: async (id: number) => {
    return await request.get({ url: `/ao/major-direction/get?id=` + id })
  },

  // 新增专业方向
  createMajorDirection: async (data: MajorDirection) => {
    return await request.post({ url: `/ao/major-direction/create`, data })
  },

  // 修改专业方向
  updateMajorDirection: async (data: MajorDirection) => {
    return await request.put({ url: `/ao/major-direction/update`, data })
  },

  // 删除专业方向
  deleteMajorDirection: async (id: number) => {
    return await request.delete({ url: `/ao/major-direction/delete?id=` + id })
  },


  // 导出专业方向 Excel
  exportMajorDirection: async (params) => {
    return await request.download({ url: `/ao/major-direction/export-excel`, params })
  },
}